<%@ page language="java" pageEncoding="UTF-8"%>
<%@page import="orest.back.userneeds.UserNeedsHandler"%>
<%@page import="net.ssta.core.db.RecordSet"%>
<%@page import="net.ssta.core.db.Record"%>
<%@page import="net.ssta.core.web.HTMLGenerator"%>
<%@page import="orest.front.achieve.AchieveHandler"%>

<%
	String path = request.getContextPath();
    String flag=request.getParameter("flag");
    UserNeedsHandler handler=new UserNeedsHandler();
    Record empty=new Record();
    empty.addData("OPTIONVALUE","");
    empty.addData("OPTIONNAME","请选择");
    empty.addData("PROVINCE_ID","");
    empty.addData("PROVINCE_NAME","请选择");
    RecordSet zdxx=new RecordSet();
    RecordSet province=new RecordSet();
    zdxx.add(empty);
    province.add(empty);
    	
    zdxx.add(AchieveHandler.getNewEnergyClassList());
    province.add(handler.getAllProvince());
    
%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<link href="<%=path%>/common/css/layout.css" rel="stylesheet" type="text/css" />
	<link href="<%=path%>/common/css/user.css" rel="stylesheet" type="text/css" />

<script type='text/javascript' src="<%=path %>/includes/js/jquery.js"></script>
<script type="text/javascript" src="<%=path %>/includes/DatePicker/WdatePicker.js"></script>

<script type="text/javascript" src="<%=path %>/includes/Fvalidate/Fvalidate.js" ></script>
<link type="text/css" rel="stylesheet" href="<%=path %>/includes/Fvalidate/style.css" />
<title>会员注册登录</title>
<style type="text/css">
<!--
body{ 
    margin:0 auto;
	font-size:12px;
	text-align:center;
	background:url(../images/bg.jpg) top center;
	background-repeat:repeat-x;
}
a {
	color: #000;
	text-decoration: none;
}
a:hover {
	color: #c30;
	text-decoration: none;
}




#logo_login{
    width:970px;
	height:69px;
	margin:0 auto;
	margin-bottom:15px;
	margin-top:5px;
	text-align:left;
	overflow:hidden;
}
#main_login_top{
    width:970px;
	height:89px;
	margin:0 auto;
	background-image:url(<%=path%>/common/images/box_top.jpg);
	overflow:hidden;
}
#main_login_main{
    width:970px;
	height:550px;
	margin:0 auto;
	background-image:url(<%=path%>/common/images/box_main.jpg);
	overflow:hidden;
}
#main_login_main_left{
    width:950px;
	height:450px;
	float:left;
	overflow:hidden;
}
#main_login_main_right{
    width:450px;
	height:400px;
	float:right;
	overflow:hidden;
	background:url(<%=path%>/common/images/line.jpg) left no-repeat;
}
#rightcontent{
    width:60%;
	height:auto;
	margin:0 auto;
	text-align:left;
	overflow:hidden;
	margin-top:90px;
	line-height:2;
}
#rightregbotton{
    width:250px;
    text-align:left;
		overflow:hidden;
		margin:0 auto;
		margin-top:10px;
}
#main_login_down{
    width:970px;
	height:76px;
	margin:0 auto;
	margin-bottom:5px;
	background-image:url(<%=path%>/common/images/box_down.jpg);
	overflow:hidden;
}
.textclass{
    width:200px;
	height:27px;
	line-height:27px;
	border:1px solid #CCCCCC;
}

#footer{
    width:970px;
	height:120px;
	border-top:4px solid #cccccc;
	margin:0 auto;
}
#footer_link{
    height:35px;
	line-height:35px;
	text-align:center;
}
#footer_copyright{
    height:85px;
	line-height:180%;
	text-align:center;
	color:#707070;
}
-->
</style>
<script type="text/javascript">


$(document).ready(function()
{
	$("#userFrom").Fvalidate({live:true});
	
});


function checkForm(){
 
   var v=$("#fuwu").attr("checked");
   if(v==false){
     alert("您没有同意我们的服务条款，不能注册");
     return;
   }
   if(!$("#userFrom").Fvalidate()){
    return false;
  }     
  
   if(re==false){
     alert("用户名已存在，请更换用户名后重试");
     return false;
  }
   var v1=$("#pwd1").val();
   var v2=$("#pwd2").val();
   if(v1==""){
      alert("请填写密码！");
      return false;
   }
   if(v1!=v2){
      alert("两次输入的密码不一样！");
      return false;
   }
   document.userFrom.submit();
   return true;
}     

var re=false;
 function checkUserName(){
 	var v=$("#userName").val();
 	
 	  $.ajax({ 
		type: "POST", url: "<%=path%>/register?method=verifyUserName",
		data:'userName='+v,
		error:function(){alert("与服务器失去联系，请刷新本页面后再重试！");},
		success: function (msg) {
			if("true"==msg){
			   alert("此账号已经被注册过了，请换一个账号进行注册");
			  re=false;
			    
			}else{
				
				 re=true;
			}
		}
	});
	 
 }
    
</script>
</head>

<body>
<div id="logo_login"><img src="<%=path%>/common/images/logo_wite.jpg" /></div>

<div id="main_login_top"></div>
<div id="main_login_main">
    <div id="main_login_main_left">
     	<form id="userFrom" action="<%=path %>/register"  name="userFrom" method="post"> 
	      	<table width="100%" border="0" cellpadding="0" cellspacing="0" align="center">
			  <tr>
				<td width="34%" height="35" align="right"><span class="bluetitle">用户名：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
				<td width="30%" align="left">
				  <input type="text"  maxlength="20" style="width:120px;" name="user_userName" class="inputtext1"   id="userName" onblur="checkUserName();"  rule="alphaAndNumber" required label="用户名"/><font color="red">*</font>
				  
				  </td>
				<td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;请输入用户名,由字母和数字组成，长度不允许超过20</td>
			  </tr>
			  <tr>
				<td align="right" height="35"><span class="bluetitle">密码：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
				<td align="left"><input type="password"  maxlength="20" name="user_pwd" style="width:120px;" class="inputtext1" required id="pwd1" label="密码"/><font color="red">*</font></td>
				<td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;请输入密码</td>
			  </tr>
			  <tr>
				<td align="right" height="35"><span class="bluetitle">重复密码：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
				<td align="left"><input type="password"  maxlength="20" style="width:120px;" class="inputtext1" id="pwd2" required label="重复密码"/><font color="red">*</font></td>
				<td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;请再次输入密码</td>
			  </tr>
			  <tr>
				<td align="right" height="35"><span class="bluetitle">性别：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
				<td align="left">
				    <input type="radio" value="男" name="user_SEX" checked="checked"/>男
                    <input type="radio" value="女" name="user_SEX"/>女 
                </td>
				<td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;</td>
			  </tr>
			  <tr>
				<td align="right" height="35"><span class="bluetitle">真实姓名：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			   <td align="left"><input type="text" name="user_FULLNAME" class="inputtext1" style="width:120px;"/></td>
				 
			   <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;请输入您的真实姓名</td>
			  </tr>
			  
			  <tr>
				<td align="right" height="35"><span class="bluetitle">出生年月：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			 	 <td align="left"><input type="text"  maxlength="20" style="width:120px;" class="inputtext1" name="user_BIRTHDAY"  readonly="readonly"  onclick="WdatePicker({dateFmt:'yyyy-MM-dd'})" /></td>
				<td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;</td>
			  </tr>
              
              <tr>
				<td align="right" height="35"><span class="bluetitle">Email：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		  		<td align="left"><input type="text"  maxlength="100" style="width:180px;" class="inputtext1" name="user_EMAIL" rule="email"  error="请输入正确的邮箱地址" label="Email" required/><font color="red">*</font></td>
				<td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;请输入正确的Email，便于激活账号</td>
			  </tr>
                <tr>
				<td align="right" height="35"><span class="bluetitle">所在行业：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			 	 <td align="left">   <%=HTMLGenerator.getSelectElementHtml("name='user_INDUSTRY' style='width:180px;'",zdxx,"OPTIONVALUE","OPTIONNAME","")%>	          </td>
				<td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;</td>
			  </tr>
              
              
               <tr>
				<td align="right" height="35"><span class="bluetitle">工作单位：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			    <td align="left"><input type="text"  maxlength="100" style="width:180px;" class="inputtext1"   name="user_WORKORG"/></td>
			   <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;</td>
			  </tr>
              
                <tr>
				<td align="right" height="35"><span class="bluetitle">电话：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
			    <td align="left"><input type="text"  maxlength="20" style="width:180px;" class="inputtext1"   name="user_TELEPHONE"/></td>
			   <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;</td>
			  </tr>
	 
	 
	 
	     	<tr>
				<td align="right" height="35"><span class="bluetitle">所在省市：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		        <td align="left"><%=HTMLGenerator.getSelectElementHtml("name='user_PROVINCE' style='width:180px;'",province,"PROVINCE_ID","PROVINCE_NAME","")%>
   	  </td>
	          <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;</td>
			  </tr>
			  
			  
			<tr>
				<td align="right" height="35"><span class="bluetitle">会员类型：</span>&nbsp;&nbsp;&nbsp;&nbsp;</td>
		      <td align="left">
                	<input type="radio" value="0" name="user_MEMBERTYPE" checked/>个人
	  				<input type="radio" value="1" name="user_MEMBERTYPE"/>企业
              </td>
			   <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;</td>
			  </tr>
			 <tr>
				<td align="right" height="35">&nbsp;</td>
		      <td align="left">
                	 <input type="checkbox" checked id="fuwu"/>同意《<A href="shengming.jsp" target="_blank" style="color:blue;">安科网服务条款和声明</A>》
              </td>
			   <td  align="left">&nbsp;&nbsp;&nbsp;&nbsp;</td>
			  </tr>
			</table>
		</form>
	 </div>
	 
		<div id="rightregbotton">
		    <a href="#33"><img src="<%=path%>/common/images/reg_botton.jpg" border="0" onclick="checkForm()"/></a>
		</div>
		
	</div>
<div id="main_login_down"></div>


<!--页面页脚-->
 <%@include file="../../common/bottom.jsp"%>    


</body>
</html>
